<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. Vladik and Complicated Book
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Vladik had started reading a complicated book about algorithms containing
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     pages. To improve understanding of what is written, his friends advised him to read pages in some order given by permutation
     <span class="tex-span">
      <i>
       P
      </i>
      = [
      <i>
       p
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       p
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
      ]
     </span>
     , where
     <span class="tex-span">
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     denotes the number of page that should be read
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th in turn.
    </p>
    <p>
     Sometimes Vladik’s mom sorted some subsegment of permutation
     <span class="tex-span">
      <i>
       P
      </i>
     </span>
     from position
     <span class="tex-span">
      <i>
       l
      </i>
     </span>
     to position
     <span class="tex-span">
      <i>
       r
      </i>
     </span>
     inclusive, because she loves the order. For every of such sorting Vladik knows number
     <span class="tex-span">
      <i>
       x
      </i>
     </span>
     — what index of page in permutation he should read. He is wondered if the page, which he will read after sorting, has changed. In other words, has
     <span class="tex-span">
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        x
       </i>
      </sub>
     </span>
     changed? After every sorting Vladik return permutation to initial state, so you can assume that each sorting is independent from each other.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     First line contains two space-separated integers
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     ,
     <span class="tex-span">
      <i>
       m
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ,
      <i>
       m
      </i>
      ≤ 10
      <sup class="upper-index">
       4
      </sup>
     </span>
     ) — length of permutation and number of times Vladik's mom sorted some subsegment of the book.
    </p>
    <p>
     Second line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     space-separated integers
     <span class="tex-span">
      <i>
       p
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       p
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       p
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       n
      </i>
     </span>
     ) — permutation
     <span class="tex-span">
      <i>
       P
      </i>
     </span>
     . Note that elements in permutation are distinct.
    </p>
    <p>
     Each of the next
     <span class="tex-span">
      <i>
       m
      </i>
     </span>
     lines contains three space-separated integers
     <span class="tex-span">
      <i>
       l
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     ,
     <span class="tex-span">
      <i>
       r
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     ,
     <span class="tex-span">
      <i>
       x
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       l
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       x
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       r
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤
      <i>
       n
      </i>
     </span>
     ) — left and right borders of sorted subsegment in
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th sorting and position that is interesting to Vladik.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     For each mom’s sorting on it’s own line print "
     <span class="tex-font-style-tt">
      Yes
     </span>
     ", if page which is interesting to Vladik hasn't changed, or "
     <span class="tex-font-style-tt">
      No
     </span>
     " otherwise.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>5 5<br/>5 4 3 2 1<br/>1 5 3<br/>1 3 1<br/>2 4 3<br/>4 4 4<br/>2 5 3<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>Yes<br/>No<br/>Yes<br/>Yes<br/>No<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>6 5<br/>1 4 3 2 5 6<br/>2 4 3<br/>1 6 2<br/>4 5 4<br/>1 3 3<br/>2 6 3<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>Yes<br/>No<br/>Yes<br/>No<br/>Yes<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     Explanation of first test case:
    </p>
    <ol>
     <li>
      <span class="tex-span">
       [1, 2, 3, 4, 5]
      </span>
      — permutation after sorting,
      <span class="tex-span">
       3
      </span>
      -rd element hasn’t changed, so answer is "
      <span class="tex-font-style-tt">
       Yes
      </span>
      ".
     </li>
     <li>
      <span class="tex-span">
       [3, 4, 5, 2, 1]
      </span>
      — permutation after sorting,
      <span class="tex-span">
       1
      </span>
      -st element has changed, so answer is "
      <span class="tex-font-style-tt">
       No
      </span>
      ".
     </li>
     <li>
      <span class="tex-span">
       [5, 2, 3, 4, 1]
      </span>
      — permutation after sorting,
      <span class="tex-span">
       3
      </span>
      -rd element hasn’t changed, so answer is "
      <span class="tex-font-style-tt">
       Yes
      </span>
      ".
     </li>
     <li>
      <span class="tex-span">
       [5, 4, 3, 2, 1]
      </span>
      — permutation after sorting,
      <span class="tex-span">
       4
      </span>
      -th element hasn’t changed, so answer is "
      <span class="tex-font-style-tt">
       Yes
      </span>
      ".
     </li>
     <li>
      <span class="tex-span">
       [5, 1, 2, 3, 4]
      </span>
      — permutation after sorting,
      <span class="tex-span">
       3
      </span>
      -rd element has changed, so answer is "
      <span class="tex-font-style-tt">
       No
      </span>
      ".
     </li>
    </ol>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
